<template>
  <bsCard class="moveDistribution-wrapper" width="100%" :height="`${cardHeight}px`">
    <div class="bs-card-title">企业迁移类型分布</div>
    <app-echarts :height="`${cardHeight - cardTitleHeight - 20}px`" :options="echartsOption" />
  </bsCard>
</template>

<script>
import bsCard from './bsCard.vue'
import appEcharts from './appEcharts.vue'
import { getTypesOfEnterpriseMigration } from '@/api/bigscreen'
export default {
  name: 'moveDistribution',
  components: {
    bsCard,
    appEcharts
  },
  inject: ['getBsLRWPercent', 'cardTitleHeight'],
  data() {
    return {
      cardHeight: 320,
      //
      echartsOption: {
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [120, 200, 150, 80, 70, 110, 130],
            type: 'bar'
          }
        ]
      }
    }
  },
  created() {
    this.fetchData()
  },
  methods: {
    async fetchData() {
      try {
        const res = await getTypesOfEnterpriseMigration()
        if (res.resultCode === 200) {
          // res.resultData
        }
      } catch (error) {
        console.log(error)
      }
    }
  }
}
</script>

<style lang='scss'>
.moveDistribution-wrapper {
  width: 100%;
}
</style>

